<?php

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */

namespace App\Controller;

use App\Service\api\messageService;
use App\Task\FooTask;

class IndexController extends AbstractController
{
    public function index()
    {
//        $user = $this->request->input('user', 'Hyperf');
//        $method = $this->request->getMethod();
//
//        return [
//            'method' => $method,
//            'message' => "Hello {$user}.",
//        ];
        $params = $this->request->all();
//        $result = make(messageService::class)->getMessageTalkList(1,$params);
//        return $result;
        if ($params['type'] == 1) {
            return make(FooTask::class)->appTaskCheck();
        } else if ($params['type'] == 2) {
            return make(FooTask::class)->sendAppTask();
        } else if ($params['type'] == 3) {
            return make(FooTask::class)->sendAppFriendTask();
        } else if ($params['type'] == 4) {
            return make(FooTask::class)->messageToFriend();
        } else if ($params['type'] == 5) {
            return make(FooTask::class)->messageToService();
        } else if ($params['type'] == 6) {
            return make(FooTask::class)->checkDevicePopTask();
        }else if ($params['type'] == 7) {
            return make(FooTask::class)->checkAccountLoginTask();
        }
    }
}
